package com.iot.demo.api;

import com.iot.demo.messge.MessageHandlerManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caixiadao
 * @version 1.0
 * 功能描述
 * XXXXX
 * @date 2021/12/16 13:57
 */
@RestController
@RequestMapping("/test/")
public class TestController {
    @Autowired
    MessageHandlerManager messageHandlerManager;
    @PostMapping("/send")
    public String test(String projectId){
        try {
              messageHandlerManager.sendCommandHandler(projectId);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return  projectId;
    }
}
